'''
GIL全局解析器锁
'''
import threading

n = 0

def task1():
	global n
	for i in range(1000000):
		n += i
	print('--------》task1中的值是：', n)
	
def task2():
	global n
	for i in range(1000000):
		n += i
	print('--------》task2中的值是：', n)
	

if __name__ == '__main__':
	t1 = threading.Thread(target=task1, name='th1')
	t2 = threading.Thread(target=task2, name='th2')
	
	t1.start()
	t2.start()
	
	t1.join()
	t2.join()
	
	print('最终结果',n)
